package com.daoeping.action;

import java.util.List;

import com.daoeping.data.Usr_projectexperience;
import com.daoeping.data.Usr_projectexperience;
import com.daoeping.service.Usr_projectexperienceService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class Usr_projectexperienceAction extends ActionSupport {
	private Usr_projectexperienceService usr_projectexperienceService;
	private Usr_projectexperience usr_projectexperience;
	public Usr_projectexperienceService getUsr_projectexperienceService() {
		return usr_projectexperienceService;
	}

	public void setUsr_projectexperienceService(
			Usr_projectexperienceService usr_projectexperienceService) {
		this.usr_projectexperienceService = usr_projectexperienceService;
	}

	public Usr_projectexperience getUsr_projectexperience() {
		return usr_projectexperience;
	}

	public void setUsr_projectexperience(Usr_projectexperience usr_projectexperience) {
		this.usr_projectexperience = usr_projectexperience;
	}

	public String addUsr_projectexperience(){
		this.usr_projectexperienceService.addUsr_projectexperience(usr_projectexperience);
		return "addUsr_projectexperience";
	}
	
	public String findUsr_projectexperienceByWorkexpId(){
		//int user_id = Usr_projectexperience.getUsr_user().getId();	
		int work_exp_id = 1;	
		Usr_projectexperience myUsr_projectexperience = ((List<Usr_projectexperience>) this.usr_projectexperienceService.findUsr_projectexperienceByWorkexpId(work_exp_id)).get(0);
		ActionContext.getContext().put("myUsr_projectexperience", myUsr_projectexperience);
		
		return "findUsr_projectexperienceByUserId";
	}
	
	public String findUsr_projectexperienceById(){
		//int user_id = Usr_projectexperience.getUsr_user().getId();	
		int work_exp_id = 1;	
		Usr_projectexperience myUsr_projectexperience = ((List<Usr_projectexperience>) this.usr_projectexperienceService.findUsr_projectexperienceByWorkexpId(work_exp_id)).get(0);
		ActionContext.getContext().put("myUsr_projectexperience", myUsr_projectexperience);
		
		return "findUsr_projectexperienceByUserId";
	}
	
	
}
